<?Php
	require_once('../Model/getconfig.php');
	//require_once('includes/checksession.php');

?>
<?php
//If the form is submitted

			$districtName=trim($_REQUEST['cmbDist']);	
			$state=trim($_REQUEST['cmbState']);	
			$cityName=trim($_REQUEST['textCity']);	
			
			if($cityName === '') {
				$hasError = true;
				$errorMessage = "Please enter a valid City name!";
			}
	/*		else
			{
				$pnid=0;
				$arrMenu=Model_membermaster::checkUserexist($username);
				foreach($arrMenu as $objMenu){ 
					$pnid=$objMenu->getuserid();
					if($pnid>0)
					{							
						$hasError = true;				
						$errorMessage = "You are entered username already exist( Enter new username)!";
					}
				}
							
			}
	*/	

			//If there is no error, send the email
		if(!isset($hasError)) {	
		
			

	$custsql="insert into matricity (C_DISTRICT, C_CITY) values ('$districtName', '$cityName')";	
			//echo $custsql;		
			$objDbManager=new Dbo_DbManager();
			$intMemmasterId=$objDbManager->dbexecute($custsql);		
							
			$success=true;
		}
			
?>		
<?php if(isset($success) == true) { ?>
	<div class="ok_box">
		<h3>City:, <?php echo $cityName ?></h3>
		<p> City insertion successfully completed. </p>
	</div>
<?php } ?>

<?php if(isset($hasError) ) { ?>
	<div class="error_box">
		There was an error submitting the form.
		<br />
		<?php echo $errorMessage;?>
	</div>
<?php } ?>